<!--
 * @Author: jhw jiaxianshengye@gmail.com
 * @LastEditTime: 2025-08-01 13:50:36
 * @LastEditors: jhw
 * @Description: 文件描述
-->
<template>
  <div style="height: 600px">
    pdfh5 依赖测试
    <div class="demo" ref="demo"></div>
  </div>
</template>

<script setup lang="ts">
import { onMounted, ref } from 'vue'
import 'pdfh5/css/pdfh5.css'
import Pdfh5 from 'pdfh5'

const demo = ref()
const pdfRef = ref()

onMounted(() => {
  pdfRef.value = new Pdfh5(demo.value, {
    pdfurl: 'https://ywtb.mps.gov.cn/nxzq/nx-ga-external-file/298108ebc82f4a0aa912824cc879dc10.pdf',
    textLayer: true,
  })

  pdfRef.value?.on('init', () => {
    console.log(111)
  })
  pdfRef.value?.on('error', () => {
    console.log('error')
  })
})
</script>

<style scoped>
.demo {
  width: 100%;
  height: 100%;
}
</style>
